from django.db import models


class Book(models.Model):
    name = models.CharField(max_length=100)
    author = models.CharField(max_length=20)
    pub_time = models.DateTimeField(auto_now_add=True)
    price = models.FloatField(default=0)

    class Meta: # 模型中Meta配置
        db_table = 'book_tables' # 修改数据库表名
        ordering = ['name'] # 排序